
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>3.2 Deployment部署 · Kubernetes - 痴者工良</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="痴者工良">
        
        
    
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-insert-logo/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-advanced-emoji/emoji-website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    


    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="3.replica.html" />
    
    
    <link rel="prev" href="1.pod.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="https://www.whuanle.cn" target="_blank" class="custom-link">痴者工良的博客</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    文档说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../1.basic/">
            
                <a href="../1.basic/">
            
                    
                    1.基础知识
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../1.basic/">
            
                <a href="../1.basic/">
            
                    
                    导读
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../1.basic/1.docker.html">
            
                <a href="../1.basic/1.docker.html">
            
                    
                    1.1 说透 Docker：基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../1.basic/2.virtual.html">
            
                <a href="../1.basic/2.virtual.html">
            
                    
                    1.2 说透 Docker： 虚拟化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../1.basic/3.docker_network.html">
            
                <a href="../1.basic/3.docker_network.html">
            
                    
                    1.3 了解 Docker 网络
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="../1.basic/4.pod_docker.html">
            
                <a href="../1.basic/4.pod_docker.html">
            
                    
                    1.4 Docker 和 Pod
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="../1.basic/5.k8s.html">
            
                <a href="../1.basic/5.k8s.html">
            
                    
                    1.5 K8S入门基础
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../2.deploy/">
            
                <a href="../2.deploy/">
            
                    
                    2.部署和配置
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../2.deploy/2.deploy.md">
            
                <span>
            
                    
                    导读
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../2.deploy/1.minikube.html">
            
                <a href="../2.deploy/1.minikube.html">
            
                    
                    2.1 使用 Minikube 部署
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../2.deploy/2.kubeadm.html">
            
                <a href="../2.deploy/2.kubeadm.html">
            
                    
                    2.2 使用 kubeadm 部署
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../2.deploy/3.kubeadm_ckad.html">
            
                <a href="../2.deploy/3.kubeadm_ckad.html">
            
                    
                    2.3 CKAD认证中的部署教程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="../2.deploy/4.kubeadm_proxy.html">
            
                <a href="../2.deploy/4.kubeadm_proxy.html">
            
                    
                    2.4 国内代理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="../2.deploy/5.dashboard.html">
            
                <a href="../2.deploy/5.dashboard.html">
            
                    
                    2.5 Dashboard
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="./">
            
                <a href="./">
            
                    
                    3.Pod部署和调度
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="./">
            
                <a href="./">
            
                    
                    导读
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="1.pod.html">
            
                <a href="1.pod.html">
            
                    
                    3.1 Pod
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.4.3" data-path="2.deployment.html">
            
                <a href="2.deployment.html">
            
                    
                    3.2 Deployment部署
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="3.replica.html">
            
                <a href="3.replica.html">
            
                    
                    3.3 副本集(ReplicaSet)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="4.pod_network.html">
            
                <a href="4.pod_network.html">
            
                    
                    3.34 Pod 端口映射
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="5.update.html">
            
                <a href="5.update.html">
            
                    
                    3.5 Pod 升级、回滚
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="6.scale.html">
            
                <a href="6.scale.html">
            
                    
                    3.6 Pod 缩放
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.8" data-path="7.lable.html">
            
                <a href="7.lable.html">
            
                    
                    3.7.Pod 标签
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.9" data-path="8.schedule.html">
            
                <a href="8.schedule.html">
            
                    
                    3.8 Pod 调度
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.10" data-path="9.jobs_cronjobs.html">
            
                <a href="9.jobs_cronjobs.html">
            
                    
                    3.9 Jobs、CronJobs
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../4.network/">
            
                <a href="../4.network/">
            
                    
                    4.Kubernetes 网络
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../4.network/">
            
                <a href="../4.network/">
            
                    
                    导读
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../4.network/1.network.html">
            
                <a href="../4.network/1.network.html">
            
                    
                    4.1 Kubernetes 网络
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../4.network/2.endpoint.html">
            
                <a href="../4.network/2.endpoint.html">
            
                    
                    4.2 Endpoint
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../4.network/3.ingress.html">
            
                <a href="../4.network/3.ingress.html">
            
                    
                    4.3 ingress
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="../4.network/4.discovery.html">
            
                <a href="../4.network/4.discovery.html">
            
                    
                    4.4 服务发现
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../5.volumes/">
            
                <a href="../5.volumes/">
            
                    
                    5.volumes
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../5.volumes/">
            
                <a href="../5.volumes/">
            
                    
                    导读
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../5.volumes/1.volumes.html">
            
                <a href="../5.volumes/1.volumes.html">
            
                    
                    5.1 卷
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../5.volumes/2.secret_configmap.html">
            
                <a href="../5.volumes/2.secret_configmap.html">
            
                    
                    5.2 secret 和 ConfigMap 卷
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../5.volumes/3.nfts.html">
            
                <a href="../5.volumes/3.nfts.html">
            
                    
                    5.3 NFS卷
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../5.volumes/4.pv_pvc.html">
            
                <a href="../5.volumes/4.pv_pvc.html">
            
                    
                    5.4 持久化卷
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../6.api_safe/">
            
                <a href="../6.api_safe/">
            
                    
                    6.API 和 安全
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../6.api_safe/">
            
                <a href="../6.api_safe/">
            
                    
                    导读
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../7.health/">
            
                <a href="../7.health/">
            
                    
                    7.维护和故障排除
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../8.health/README.md">
            
                <span>
            
                    
                    导读
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../k8s.html">
            
                <a href="../k8s.html">
            
                    
                    Kubernetes 命令概览
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../ckad.html">
            
                <a href="../ckad.html">
            
                    
                    CKAD 认证帮助
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >3.2 Deployment部署</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-navicon"></i><ul><li><span class="title-icon "></span><a href="#32-deployment&#x90E8;&#x7F72;"><b></b>3.2 Deployment&#x90E8;&#x7F72;</a></li><ul><li><span class="title-icon "></span><a href="#deployment"><b></b>Deployment</a></li><ul><li><span class="title-icon "></span><a href="#&#x521B;&#x5EFA;-deployment"><b></b>&#x521B;&#x5EFA; Deployment</a></li><li><span class="title-icon "></span><a href="#kubectl-applycreate"><b></b>kubectl apply/create</a></li><li><span class="title-icon "></span><a href="#&#x68C0;&#x67E5;-yaml"><b></b>&#x68C0;&#x67E5; YAML</a></li><li><span class="title-icon "></span><a href="#&#x67E5;&#x770B;-deployment"><b></b>&#x67E5;&#x770B; Deployment</a></li><li><span class="title-icon "></span><a href="#&#x67E5;&#x770B;-pod"><b></b>&#x67E5;&#x770B; Pod</a></li><li><span class="title-icon "></span><a href="#&#x5B9E;&#x65F6;&#x4FEE;&#x6539;"><b></b>&#x5B9E;&#x65F6;&#x4FEE;&#x6539;</a></li><li><span class="title-icon "></span><a href="#&#x5BFC;&#x51FA;-yaml"><b></b>&#x5BFC;&#x51FA; yaml</a></li><li><span class="title-icon "></span><a href="#&#x591A;&#x4E2A;-&#x5BB9;&#x5668;"><b></b>&#x591A;&#x4E2A; &#x5BB9;&#x5668;</a></li><li><span class="title-icon "></span><a href="#&#x603B;&#x7ED3;"><b></b>&#x603B;&#x7ED3;</a></li></ul></ul></ul></div><h1 id="32-deployment&#x90E8;&#x7F72;"><a name="32-deployment&#x90E8;&#x7F72;" class="anchor-navigation-ex-anchor" href="#32-deployment&#x90E8;&#x7F72;"><i class="fa fa-link" aria-hidden="true"></i></a>3.2 Deployment&#x90E8;&#x7F72;</h1>
<p>Deployment &#x662F; Kubernetes <strong>&#x63D0;&#x4F9B;&#x7684;&#x4E00;&#x79CD;&#x81EA;&#x6211;&#x4FEE;&#x590D;&#x673A;&#x5236;&#x6765;&#x89E3;&#x51B3;&#x673A;&#x5668;&#x6545;&#x969C;&#x7EF4;&#x62A4;&#x7684;&#x95EE;&#x9898;</strong>&#x3002;&#x524D;&#x9762;&#x63D0;&#x5230;&#x4E86;&#x5355;&#x72EC;&#x90E8;&#x7F72; Pod&#xFF0C;&#x4F46;&#x662F;&#x8FD9;&#x79CD;&#x65B9;&#x5F0F;&#x53EA;&#x9002;&#x5408;&#x4E34;&#x65F6;&#x7684; Pod&#xFF0C;&#x7528;&#x4E8E;&#x6D4B;&#x8BD5;&#x8C03;&#x8BD5;&#x3002;&#x5982;&#x679C;&#x8981;&#x7528;&#x4E8E;&#x751F;&#x4EA7;&#xFF0C;&#x5219;&#x9700;&#x8981; Deployment &#x7B49;&#x63A7;&#x5236;&#x5668;&#x7BA1;&#x7406;&#x90E8;&#x7F72; Pod&#xFF0C;&#x7EF4;&#x62A4; Pod &#x7684;&#x526F;&#x672C;&#x6570;&#x91CF;&#x4EE5;&#x53CA; Pod &#x76D1;&#x63A7;&#x548C;&#x7EF4;&#x62A4;&#x3002;</p>
<p>&#x5BF9;&#x4E8E; Kubernetes &#x5BF9;&#x8C61;&#x7684;&#x90E8;&#x7F72;&#xFF0C;&#x4F8B;&#x5982; Pod&#x3001;Deployment&#x3001;Service &#x7B49;&#xFF0C;&#x6709;&#x4E09;&#x79CD;&#x90E8;&#x7F72;&#x65B9;&#x5F0F;&#xFF1A;</p>
<ul>
<li>Using Generators (Run, Expose)</li>
<li>Using Imperative way (Create)</li>
<li>Using Declarative way (Apply)</li>
</ul>
<p>&#x5728; 2.1 &#x7AE0;&#x4E2D;&#xFF0C;&#x6211;&#x4EEC;&#x5DF2;&#x7ECF;&#x5B66;&#x4E60;&#x4E86; <code>Run</code> &#x548C; <code>apply</code> &#x7B49;&#xFF0C;&#x5728;&#x672C;&#x7BC7;&#x4EE5;&#x53CA;&#x540E;&#x9762;&#x7684;&#x7AE0;&#x8282;&#x4E2D;&#xFF0C;&#x6211;&#x4EEC;&#x4F1A;&#x4E00;&#x6B65;&#x6B65;&#x6DF1;&#x5165;&#x5B66;&#x4E60;&#x8FD9;&#x4E9B;&#x90E8;&#x7F72;&#x65B9;&#x5F0F;&#x3002;</p>
<p>&#x672C;&#x7BC7;&#x5305;&#x542B;&#x6216;&#x9700;&#x8981;&#x638C;&#x63E1;&#x4EE5;&#x4E0B;&#x5185;&#x5BB9;&#xFF1A;</p>
<blockquote>
<ul>
<li>&#x521B;&#x5EFA; Deployment</li>
<li>&#x4FEE;&#x6539; Deployment</li>
<li>&#x67E5;&#x770B; Deployment &#x3001;Pod&#x3001;Services&#x3001;&#x526F;&#x672C;</li>
</ul>
</blockquote>
<p>&#x5728;&#x672C;&#x7BC7;&#x6587;&#x7AE0;&#x4E2D;&#xFF0C;&#x6211;&#x4EEC;&#x5C06;&#x90E8;&#x7F72;&#x4E00;&#x4E2A; Nginx &#x5B9E;&#x4F8B;&#xFF0C;&#x5E76;&#x5B66;&#x4F1A; &#x90E8;&#x7F72;&#x4EE5;&#x53CA;&#x7BA1;&#x7406; Deployment&#x3001;Pod&#x3002;</p>
<h2 id="deployment"><a name="deployment" class="anchor-navigation-ex-anchor" href="#deployment"><i class="fa fa-link" aria-hidden="true"></i></a>Deployment</h2>
<p>&#x5F53;&#x6211;&#x4EEC;&#x5355;&#x72EC;&#x4F7F;&#x7528; docker &#x90E8;&#x7F72;&#x5E94;&#x7528;&#x65F6;&#xFF0C;&#x4E3A;&#x4E86;&#x5E94;&#x7528;&#x6302;&#x4E86;&#x540E;&#x80FD;&#x591F;&#x91CD;&#x542F;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; <code>--restart=always</code> &#x53C2;&#x6570;&#xFF0C;&#x4F8B;&#x5982;&#xFF1A;</p>
<pre class="language-"><code class="lang-bash">docker run -itd --restart<span class="token operator">=</span>always -p <span class="token number">666</span>:80 nginx:latest
</code></pre>
<p>&#x4F46;&#x662F;&#x8FD9;&#x79CD;&#x65B9;&#x5F0F;&#x53EA;&#x80FD;&#x5355;&#x7EAF;&#x91CD;&#x542F;&#x5BB9;&#x5668;&#xFF0C;&#x5E76;&#x4E0D;&#x5177;&#x5907;&#x4ECE;&#x673A;&#x5668;&#x6545;&#x969C;&#x4E2D;&#x6062;&#x590D;&#x7684;&#x80FD;&#x529B;&#xFF0C;&#x5373;&#x5F53;&#x4E00;&#x53F0;&#x670D;&#x52A1;&#x5668;&#x6302;&#x4E86;&#x540E;&#xFF0C;&#x6B64;&#x670D;&#x52A1;&#x5668;&#x4E0A;&#x6240;&#x6709;&#x7684;&#x5BB9;&#x5668;&#x5168;&#x90E8;&#x6302;&#x6389;&#x3002;</p>
<p>Kubernetes Deployment &#x662F;&#x4E00;&#x79CD; Pod &#x7BA1;&#x7406;&#x65B9;&#x5F0F;&#xFF0C;&#x5B83;&#x53EF;&#x4EE5;&#x6307;&#x6325; Kubernetes &#x5982;&#x4F55;&#x521B;&#x5EFA;&#x548C;&#x66F4;&#x65B0;&#x4F60;&#x90E8;&#x7F72;&#x7684;&#x5E94;&#x7528;&#x5B9E;&#x4F8B;&#xFF0C;&#x521B;&#x5EFA; Deployment &#x540E;&#xFF0C;Kubernetes master &#x4F1A;&#x5C06;&#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x8C03;&#x5EA6;&#x5230;&#x96C6;&#x7FA4;&#x4E2D;&#x7684;&#x5404;&#x4E2A;&#x8282;&#x70B9;&#x4E0A;&#x3002;Kubernetes Deployment &#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x79CD;&#x4E0E;&#x4F17;&#x4E0D;&#x540C;&#x7684;&#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x7BA1;&#x7406;&#x65B9;&#x6CD5;&#x3002;</p>
<p>Deployment &#x7684;&#x521B;&#x5EFA;&#xFF0C;&#x6709;&#x4E24;&#x79CD;&#x65B9;&#x6CD5;&#xFF0C;&#x4E00;&#x79CD;&#x662F;&#x76F4;&#x63A5;&#x4F7F;&#x7528;&#x547D;&#x4EE4;&#x521B;&#x5EFA;(<code>kubectl create</code>)&#xFF0C;&#x4E00;&#x79CD;&#x662F;&#x901A;&#x8FC7; YAML(<code>kubectl apply</code>)&#xFF0C;&#x540E;&#x9762;&#x6211;&#x4EEC;&#x4F1A;&#x4ECB;&#x7ECD;&#x8FD9;&#x4E24;&#x79CD;&#x521B;&#x5EFA;&#x65B9;&#x6CD5;&#x3002;</p>
<h3 id="&#x521B;&#x5EFA;-deployment"><a name="&#x521B;&#x5EFA;-deployment" class="anchor-navigation-ex-anchor" href="#&#x521B;&#x5EFA;-deployment"><i class="fa fa-link" aria-hidden="true"></i></a>&#x521B;&#x5EFA; Deployment</h3>
<p>&#x5728; Kubernetes &#x4E2D;&#xFF0C;Pod &#x662F;&#x8C03;&#x5EA6;&#x7684;&#x6700;&#x5C0F;&#x5355;&#x4F4D;&#xFF0C;&#x4E00;&#x4E2A; Pod &#x4E2D;&#x5305;&#x542B;&#x591A;&#x4E2A; &#x5BB9;&#x5668;&#xFF0C;&#x6240;&#x4EE5;&#x6211;&#x4EEC;&#x7684;&#x5404;&#x79CD;&#x64CD;&#x4F5C;&#x90FD;&#x662F;&#x5728; Pod &#x4E4B;&#x4E0A;&#x3002;</p>
<p>&#x6211;&#x4EEC;&#x6765;&#x4F7F;&#x7528; deployment &#x90E8;&#x7F72;&#x4E00;&#x4E2A; Pod&#xFF0C;&#x8FD9;&#x4E2A; Pod &#x5305;&#x542B;&#x4E00;&#x4E2A; Nginx &#x5BB9;&#x5668;&#x3002;</p>
<pre class="language-"><code class="lang-bash">kubectl create deployment nginx --image<span class="token operator">=</span>nginx:latest
</code></pre>
<p>&#x683C;&#x5F0F;&#xFF1A;</p>
<pre class="language-"><code class="lang-bash">kubectl create deployment <span class="token punctuation">{</span>deployment&#x5BF9;&#x8C61;&#x540D;&#x79F0;<span class="token punctuation">}</span> --images<span class="token operator">=</span><span class="token punctuation">{</span>&#x955C;&#x50CF;&#x540D;&#x79F0;&#x548C;&#x6807;&#x7B7E;<span class="token punctuation">}</span>
</code></pre>
<p>&#x6B64;&#x65F6;&#xFF0C;nginx &#x5BB9;&#x5668;&#x4F1A;&#x4EE5; Pod &#x7684;&#x65B9;&#x5F0F;&#x90E8;&#x7F72;&#x5230;&#x8282;&#x70B9;&#x4E2D;&#xFF0C;&#x4F46;&#x662F;&#x88AB;&#x90E8;&#x7F72;&#x5230;&#x54EA;&#x4E2A;&#x8282;&#x70B9;&#x662F;&#x968F;&#x673A;&#x7684;&#xFF0C;&#x5982;&#x679C;&#x4F60;&#x53EA;&#x6709;&#x4E00;&#x4E2A; worker &#x8282;&#x70B9;&#xFF0C;&#x5219; Pod &#x5FC5;&#x5B9A;&#x5728;&#x8FD9;&#x4E2A; Worker &#x8282;&#x70B9;&#x4E0A;&#x3002;&#x5F53;&#x7136;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x83B7;&#x53D6;&#x5230;&#x5177;&#x4F53;&#x7684;&#x8C03;&#x5EA6;&#x4FE1;&#x606F;&#xFF0C;&#x4ECE;&#x4E2D;&#x67E5;&#x770B; Pod &#x88AB;&#x8C03;&#x5EA6;&#x5230;&#x54EA;&#x4E2A;&#x8282;&#x70B9;&#x3002;</p>
<pre class="language-"><code class="lang-bash">root@instance-1:~<span class="token comment"># kubectl get deployments -o wide</span>
NAME    READY   UP-TO-DATE   AVAILABLE   AGE   CONTAINERS   IMAGES         SELECTOR
nginx   <span class="token number">1</span>/1     <span class="token number">1</span>            <span class="token number">1</span>           52s   nginx        nginx:latest   <span class="token assign-left variable">app</span><span class="token operator">=</span>nginx
root@instance-1:~<span class="token comment"># kubectl get pods -o wide</span>
NAME                     READY   STATUS    RESTARTS   AGE   IP             NODE         NOMINATED NODE   READINESS GATES
nginx-55649fd747-s4824   <span class="token number">1</span>/1     Running   <span class="token number">0</span>          61s   <span class="token number">192.168</span>.56.4   instance-2   <span class="token operator">&lt;</span>none<span class="token operator">&gt;</span>           <span class="token operator">&lt;</span>none<span class="token operator">&gt;</span>
</code></pre>
<p>&#x53EF;&#x4EE5;&#x770B;&#x5230;&#xFF0C; Pod &#x5728; instance-2 &#x4E2D;&#x8FD0;&#x884C;&#x7740;&#x3002;</p>
<p>Deployment &#x4F1A;&#x4E3A;&#x6211;&#x4EEC;&#x81EA;&#x52A8;&#x521B;&#x5EFA; Pod&#xFF0C;Pod &#x7531; <code>{deployment&#x540D;&#x79F0;}-{&#x968F;&#x673A;&#x540D;&#x79F0;}</code> &#x7EC4;&#x6210;&#x3002;</p>
<blockquote>
<p><strong>[Info] &#x63D0;&#x793A;</strong></p>
<p>&#x8FD8;&#x6709;&#x4E00;&#x4E2A;&#x5730;&#x65B9;&#x4E5F;&#x8BF4;&#x4E00;&#x4E0B;&#xFF0C;<code>kubectl get xxx</code> &#x65F6;&#xFF0C;&#x5E26;&#x4E0D;&#x5E26; <code>s</code> &#x90FD;&#x6CA1;&#x5173;&#x7CFB;&#xFF0C;&#x4F8B;&#x5982; <code>kubectl get nodes</code> / <code>kubectl get node</code> &#x90FD;&#x662F;&#x4E00;&#x6837;&#x7684;&#x3002;</p>
<p>&#x4E0D;&#x8FC7;&#xFF0C;&#x4E00;&#x822C;&#x4ECE;&#x8BED;&#x4E49;&#x4E0A;&#xFF0C;&#x6211;&#x4EEC;&#x83B7;&#x53D6;&#x5168;&#x90E8;&#x5BF9;&#x8C61;&#x65F6;&#xFF0C;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; <code>kubectl get nodes</code>&#xFF0C;&#x83B7;&#x53D6;&#x5177;&#x4F53;&#x7684;&#x5BF9;&#x8C61;&#x65F6;&#xFF0C;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; <code>kubectl get node nginx</code>&#x3002;&#x7C7B;&#x4F3C;&#x7684;&#xFF0C;<code>kubectl describe nodes</code> &#x3001;<code>kubectl describe node nginx</code>&#x3002;&#x5B9E;&#x9645;&#x4E0A;&#x52A0;&#x4E0D;&#x52A0; <code>s</code> &#x90FD;&#x4E00;&#x6837;&#x3002;</p>
</blockquote>
<h3 id="kubectl-applycreate"><a name="kubectl-applycreate" class="anchor-navigation-ex-anchor" href="#kubectl-applycreate"><i class="fa fa-link" aria-hidden="true"></i></a>kubectl apply/create</h3>
<p>&#x5F53;&#x6211;&#x4EEC;&#x521B;&#x5EFA;&#x4E00;&#x4E2A; deployment &#x65F6;&#xFF0C;<code>kubectl create</code> &#x548C; <code>kubectl apply</code> &#x6548;&#x679C;&#x662F;&#x4E00;&#x6837;&#x7684;&#xFF0C;&#x4F46;&#x662F; <code>apply</code> &#x8FD8;&#x5177;&#x6709;&#x66F4;&#x65B0;(update) &#x7684;&#x529F;&#x80FD;&#x3002;</p>
<p><code>kubectl apply</code> &#x4F1A;&#x5728;&#x4EE5;&#x524D;&#x7684;&#x914D;&#x7F6E;&#x3001;&#x63D0;&#x4F9B;&#x7684;&#x8F93;&#x5165;&#x548C;&#x8D44;&#x6E90;&#x7684;&#x5F53;&#x524D;&#x914D;&#x7F6E;&#x4E4B;&#x95F4; &#x627E;&#x51FA;&#x4E09;&#x65B9;&#x5DEE;&#x5F02;&#xFF0C;&#x4EE5;&#x786E;&#x5B9A;&#x5982;&#x4F55;&#x4FEE;&#x6539;&#x8D44;&#x6E90;&#xFF0C;<code>kubectl apply</code> &#x547D;&#x4EE4;&#x5C06;&#x4F1A;&#x628A;&#x63A8;&#x9001;&#x7684;&#x7248;&#x672C;&#x4E0E;&#x4EE5;&#x524D;&#x7684;&#x7248;&#x672C;&#x8FDB;&#x884C;&#x6BD4;&#x8F83;&#xFF0C;&#x5E76;&#x5E94;&#x7528;&#x4F60;&#x6240;&#x505A;&#x7684;&#x66F4;&#x6539;&#xFF0C; &#x4F46;&#x662F;&#x4E0D;&#x4F1A;&#x81EA;&#x52A8;&#x8986;&#x76D6;&#x4EFB;&#x4F55;&#x4F60;&#x6CA1;&#x6709;&#x6307;&#x5B9A;&#x66F4;&#x6539;&#x7684;&#x5C5E;&#x6027;</p>
<p>&#x53E6;&#x5916;&#x8FD8;&#x6709; <code>kubectl replace</code> &#x3001;<code>kubectl edit</code>&#x3002;<code>kubectl replace</code> &#x662F;&#x7834;&#x574F;&#x6027;&#x66F4;&#x65B0;/&#x66FF;&#x6362;&#xFF0C;&#x5BB9;&#x6613;&#x5BFC;&#x81F4;&#x95EE;&#x9898;&#xFF1B;<code>kubectl edit</code> &#x53EF;&#x4EE5;&#x66F4;&#x65B0; Deployment &#x7B49;&#x5DF2;&#x5B58;&#x5728;&#x7684;&#x5BF9;&#x8C61;&#x3002;</p>
<p>&#x6839;&#x636E; Kubernetes &#x5B98;&#x65B9;&#x7684;&#x6587;&#x6863;&#x8BF4;&#x660E;&#xFF0C;<strong>&#x5E94;&#x59CB;&#x7EC8;&#x4F7F;&#x7528; <code>kubectl apply</code> &#x6216; <code>kubectl create --save-config</code> &#x521B;&#x5EFA;&#x8D44;&#x6E90;</strong>&#x3002;</p>
<p>&#x524D;&#x9762;&#x5DF2;&#x7ECF;&#x5B66;&#x4E60;&#x4E86; <code>kubectl create</code>&#xFF0C;&#x8FD9;&#x91CC;&#x5B66;&#x4E60;&#x4E00;&#x4E0B; <code>kubectl apply</code>&#x3002;</p>
<p>&#x901A;&#x8FC7; YAML &#x6587;&#x4EF6;&#x90E8;&#x7F72; nginx&#xFF1A;</p>
<pre class="language-"><code class="lang-bash">kubectl apply -f https://k8s.io/examples/controllers/nginx-deployment.yaml
</code></pre>
<blockquote>
<p>&#x5F88;&#x591A;&#x5F00;&#x6E90;&#x8F6F;&#x4EF6;&#x63D0;&#x4F9B;&#x4E86; YAML &#x6587;&#x4EF6;&#xFF0C;&#x6211;&#x4EEC;&#x901A;&#x8FC7; YAML &#x6587;&#x4EF6;&#x53EF;&#x4EE5;&#x5FEB;&#x901F;&#x90E8;&#x7F72;&#x670D;&#x52A1;&#xFF0C;&#x5982; Redis&#x3001;Consul &#x7B49;&#x3002;</p>
</blockquote>
<p>&#x8FD9;&#x91CC;&#x518D;&#x8BF4;&#x4E00;&#x4E0B;&#x521B;&#x5EFA; Deployment &#x7684;&#x533A;&#x522B;&#x3002;</p>
<p>&#x5982;&#x679C;&#x4F7F;&#x7528; create &#x521B;&#x5EFA;&#xFF0C;&#x547D;&#x4EE4;&#x683C;&#x5F0F;&#xFF1A;</p>
<pre class="language-"><code class="lang-bash">kubectl create deployment <span class="token punctuation">{</span>deployment&#x7684;&#x540D;&#x5B57;<span class="token punctuation">}</span> --image<span class="token operator">=</span><span class="token punctuation">{</span>&#x955C;&#x50CF;&#x540D;&#x79F0;<span class="token punctuation">}</span>
</code></pre>
<p>&#x5982;&#x679C;&#x4F7F;&#x7528; apply &#x547D;&#x4EE4;&#x521B;&#x5EFA;&#xFF0C;YAML &#x4E2D;&#x9700;&#x8981;&#x6307;&#x5B9A;&#x4E00;&#x4E9B;&#x4FE1;&#x606F;&#xFF0C;&#x53EF;&#x5B9A;&#x5236;&#x6027;&#x5F88;&#x9AD8;&#x3002;</p>
<pre class="language-"><code class="lang-yaml"><span class="token key atrule">kind</span><span class="token punctuation">:</span> Deployment
<span class="token punctuation">...</span> <span class="token punctuation">...</span>
<span class="token key atrule">medatada</span><span class="token punctuation">:</span>
    name<span class="token punctuation">:</span>nginx
<span class="token punctuation">...</span> <span class="token punctuation">...</span>
    <span class="token key atrule">spec</span><span class="token punctuation">:</span>
      <span class="token key atrule">containers</span><span class="token punctuation">:</span>
      <span class="token punctuation">-</span> <span class="token key atrule">image</span><span class="token punctuation">:</span> nginx<span class="token punctuation">:</span>latest
</code></pre>
<p>&#x7136;&#x540E;&#x6267;&#x884C; <code>kubectl apply -f xxx.yaml</code> &#x6587;&#x4EF6;&#x3002;</p>
<p>&#x4E00;&#x4E2A;&#x662F; <code>kubectl create deployment</code> &#xFF1B;&#x53E6;&#x4E00;&#x4E2A;&#x662F; <code>kubectl apply -f</code>&#xFF0C;&#x5728; yaml &#x4E2D;&#x6307;&#x5B9A; <code>kind: Deployment</code>&#x3002;</p>
<p>&#x5982;&#x679C;&#x6211;&#x4EEC;&#x53EA;&#x9700;&#x8981;&#x5FEB;&#x901F;&#x521B;&#x5EFA;&#xFF0C;&#x4F7F;&#x7528;&#x547D;&#x4EE4;&#x5F62;&#x5F0F;&#x5C31;&#x884C;&#xFF1B;&#x5982;&#x4F55;&#x751F;&#x4EA7;&#x751F;&#x4EA7;&#xFF0C;&#x8FD8;&#x662F;&#x5F97;&#x4F7F;&#x7528; YAML &#x6587;&#x4EF6;&#xFF0C;&#x5E76;&#x4E8E;&#x7559;&#x5B58;&#x8BB0;&#x5F55;&#x3002;</p>
<p>&#x8981;&#x5220;&#x9664;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; <code>kubectl delete -f {&#x540D;&#x79F0;}.yaml</code>&#xFF0C;&#x5982;&#x5220;&#x9664;  calico&#x3002;</p>
<pre class="language-"><code class="lang-bash">kubectl delete -f calico.yaml
</code></pre>
<h3 id="&#x68C0;&#x67E5;-yaml"><a name="&#x68C0;&#x67E5;-yaml" class="anchor-navigation-ex-anchor" href="#&#x68C0;&#x67E5;-yaml"><i class="fa fa-link" aria-hidden="true"></i></a>&#x68C0;&#x67E5; YAML</h3>
<p>&#x6709;&#x65F6;&#x6211;&#x4EEC;&#x4E0D;&#x77E5;&#x9053;&#x6211;&#x4EEC;&#x7684;&#x521B;&#x5EFA;&#x547D;&#x4EE4;&#x6216; yaml &#x662F;&#x5426;&#x6B63;&#x786E;&#xFF0C;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; <code>--dry-run=client</code> &#xFF0C;<code>--dry-run=client</code> &#x53C2;&#x6570;&#x6765;&#x8868;&#x793A;&#x5F53;&#x524D;&#x5185;&#x5BB9;&#x53EA;&#x662F;&#x9884;&#x89C8;&#x800C;&#x4E0D;&#x771F;&#x6B63;&#x63D0;&#x4EA4;&#x3002;</p>
<pre class="language-"><code class="lang-bash">kubectl create deployment testnginx --image<span class="token operator">=</span>nginx:latest --dry-run<span class="token operator">=</span>client
</code></pre>
<p>&#x5728;&#x4E00;&#x4E9B; k8s &#x8BA4;&#x8BC1;&#x4E2D;&#xFF0C;&#x6211;&#x4EEC;&#x6CA1;&#x65F6;&#x95F4;&#x4E00;&#x70B9;&#x70B9;&#x5199; yaml &#xFF0C;&#x4F46;&#x662F;&#x53C8;&#x9700;&#x8981;&#x5B9A;&#x5236;&#xFF0C;&#x6B64;&#x65F6;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; <code>--dry-run=client -o yaml</code> &#xFF0C;&#x65E2;&#x53EF;&#x4EE5;&#x4E0D;&#x751F;&#x6548; Deployment&#xFF0C;&#x53C8;&#x53EF;&#x4EE5;&#x5BFC;&#x51FA; yaml &#x6587;&#x4EF6;&#x3002;</p>
<blockquote>
<p> <strong>[Info] &#x63D0;&#x793A;</strong></p>
<p> <code>-o wide</code> &#x53EF;&#x4EE5;&#x67E5;&#x770B;&#x5BF9;&#x8C61;&#x66F4;&#x591A;&#x7684;&#x5B57;&#x6BB5;&#x4FE1;&#x606F;&#xFF1B;<code>kubectl describe</code> &#x53EF;&#x4EE5;&#x67E5;&#x770B;&#x5BF9;&#x8C61;&#x7684;&#x5168;&#x90E8;&#x8BE6;&#x7EC6;&#x4FE1;&#x606F;&#xFF1B;<code>-o yaml</code> &#x6216; <code>-o json</code> &#x53EF;&#x4EE5;&#x67E5;&#x770B;&#x5BF9;&#x8C61;&#x7684;&#x5B9A;&#x4E49;/&#x63CF;&#x8FF0;&#x6587;&#x4EF6;&#x3002;</p>
<p> <code>--dry-run</code> &#x53D6;&#x503C;&#x5FC5;&#x987B;&#x4E3A;none&#x3001;server&#x6216;client&#x3002;&#x5982;&#x679C;&#x5BA2;&#x6237;&#x7AEF;&#x7B56;&#x7565;&#xFF0C;&#x53EA;&#x6253;&#x5370;&#x5C06;&#x8981;&#x53D1;&#x9001;&#x7684;&#x5BF9;&#x8C61;&#xFF0C;&#x800C;&#x4E0D;&#x53D1;&#x9001;&#x5B83;&#x3002;&#x5982;&#x679C;&#x662F;&#x670D;&#x52A1;&#x5668;&#x7B56;&#x7565;&#xFF0C;&#x63D0;&#x4EA4;&#x670D;&#x52A1;&#x5668;&#x7AEF;&#x8BF7;&#x6C42;&#x800C;&#x4E0D;&#x6301;&#x4E45;&#x5316;&#x8D44;&#x6E90;&#x3002;</p>
</blockquote>
<p>&#x547D;&#x4EE4;&#x793A;&#x4F8B;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre class="language-"><code class="lang-bash">kubectl create deployment testnginx --image<span class="token operator">=</span>nginx:latest --dry-run<span class="token operator">=</span>client -o yaml
<span class="token comment"># -o json &#x53EF;&#x4EE5;&#x8F93;&#x51FA; json &#x683C;&#x5F0F;</span>
</code></pre>
<p><img src="images/toyaml.png" alt="toyaml"></p>
<p>&#x4F7F;&#x7528;&#x8FD9;&#x6837;&#x7684;&#x65B9;&#x6CD5;&#xFF0C;&#x53EF;&#x4EE5;&#x5FEB;&#x901F;&#x83B7;&#x5F97;&#x9700;&#x8981;&#x7684; YAML &#x6A21;&#x677F;&#xFF0C;&#x7136;&#x540E;&#x590D;&#x5236;&#x5230; YAML &#x6587;&#x4EF6;&#xFF0C;&#x6839;&#x636E;&#x9700;&#x8981;&#x6539;&#x52A8;&#x3001;&#x5B9A;&#x5236;&#x3002;&#x9664;&#x4E86; deployment&#xFF0C;&#x5176;&#x5B83; kubernetes &#x5BF9;&#x8C61;&#x4E5F;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x8FD9;&#x79CD;&#x65B9;&#x6CD5;&#x3002;</p>
<h3 id="&#x67E5;&#x770B;-deployment"><a name="&#x67E5;&#x770B;-deployment" class="anchor-navigation-ex-anchor" href="#&#x67E5;&#x770B;-deployment"><i class="fa fa-link" aria-hidden="true"></i></a>&#x67E5;&#x770B; Deployment</h3>
<p>&#x6211;&#x4EEC;&#x4EE5; Deployment &#x7684;&#x65B9;&#x5F0F;&#x90E8;&#x7F72; Pod &#xFF0C;&#x5C31;&#x4F1A;&#x521B;&#x5EFA;&#x4E00;&#x4E2A; Deployment &#x5BF9;&#x8C61;&#xFF0C;&#x83B7;&#x5F97; deployment &#x5217;&#x8868;&#xFF1A;</p>
<pre class="language-"><code class="lang-bash">kubectl get deployments
kubectl get deployments -o wide
</code></pre>
<pre class="language-"><code class="lang-bash">NAME    READY   UP-TO-DATE   AVAILABLE   AGE
nginx   <span class="token number">1</span>/1     <span class="token number">1</span>            <span class="token number">1</span>           2m24s

NAME    READY   UP-TO-DATE   AVAILABLE   AGE     CONTAINERS   IMAGES         SELECTOR
nginx   <span class="token number">1</span>/1     <span class="token number">1</span>            <span class="token number">1</span>           2m42s   nginx        nginx:latest   <span class="token assign-left variable">app</span><span class="token operator">=</span>nginx
</code></pre>
<blockquote>
<p>&#x5728; <code>kubectl get ...</code> &#x540E;&#x9762;&#x52A0;&#x4E0A; <code>-o wide</code> &#x53EF;&#x4EE5;&#x83B7;&#x5F97;&#x66F4;&#x591A;&#x7684;&#x6807;&#x7B7E;&#x4FE1;&#x606F;&#x3002;</p>
</blockquote>
<p>&#x4F7F;&#x7528; <code>kubectl get events</code> &#x53EF;&#x4EE5;&#x83B7;&#x5F97;&#x96C6;&#x7FA4;&#x4E2D;&#x6700;&#x8FD1;&#x53D1;&#x751F;&#x7684;&#x4E8B;&#x4EF6;&#xFF0C;&#x5982;&#x521B;&#x5EFA; Deployment &#x5230;&#x90E8;&#x7F72;&#x5BB9;&#x5668;&#x8FC7;&#x7A0B;&#x7684;&#x8BE6;&#x7EC6;&#x4E8B;&#x4EF6;&#x8BB0;&#x5F55;&#x3002;</p>
<pre class="language-"><code>Successfully assigned default/nginx-55649fd747-wdrjj to instance-2
Pulling image &quot;nginx:latest&quot;
Successfully pulled image &quot;nginx:latest&quot; in 8.917597859s
Created container nginx
Started container nginx
Created pod: nginx-55649fd747-wdrjj
Scaled up replica set nginx-55649fd747 to 1
</code></pre><p>&#x4F7F;&#x7528; <code>kubectl describe deployment nginx</code> &#x53EF;&#x4EE5;&#x83B7;&#x5F97;&#x66F4;&#x52A0;&#x8BE6;&#x7EC6;&#x7684;&#x4FE1;&#x606F;&#xFF0C;&#x662F;&#x5404;&#x79CD;&#x4FE1;&#x606F;&#x7684;&#x96C6;&#x5408;&#x3002;</p>
<p><img src="images/describe&#x547D;&#x4EE4;.png" alt="describe&#x547D;&#x4EE4;"></p>
<h3 id="&#x67E5;&#x770B;-pod"><a name="&#x67E5;&#x770B;-pod" class="anchor-navigation-ex-anchor" href="#&#x67E5;&#x770B;-pod"><i class="fa fa-link" aria-hidden="true"></i></a>&#x67E5;&#x770B; Pod</h3>
<p>&#x6211;&#x4EEC;&#x6CA1;&#x6709;&#x76F4;&#x63A5;&#x521B;&#x5EFA; Pod&#xFF0C;&#x800C;&#x662F;&#x901A;&#x8FC7; Deployment &#x521B;&#x5EFA;&#xFF0C;&#x63A5;&#x4E0B;&#x6765;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x4E86;&#x89E3;&#x5982;&#x4F55;&#x67E5;&#x770B; Pod &#x3002;</p>
<pre class="language-"><code class="lang-bash">kubectl get pods
</code></pre>
<pre class="language-"><code class="lang-bash">NAME                     READY   STATUS    RESTARTS   AGE
nginx-55649fd747-msw8g   <span class="token number">1</span>/1     Running   <span class="token number">0</span>          4h16m
</code></pre>
<p>&#x53EF;&#x4EE5;&#x770B;&#x5230;&#x4E00;&#x4E2A; Pod &#x540D;&#x4E3A; <code>nginx-</code> &#xFF0C;&#x56E0;&#x4E3A;&#x6211;&#x4EEC;&#x662F;&#x5229;&#x7528; Deployment &#x90E8;&#x7F72; Pod &#x7684;&#xFF0C;&#x6CA1;&#x6709;&#x6307;&#x5B9A;&#x8FD9;&#x4E2A; Pod &#x7684;&#x540D;&#x79F0;&#xFF0C;&#x6240;&#x4EE5;&#x9ED8;&#x8BA4; Pod &#x540D;&#x79F0;&#x4EE5; Deployment &#x540D;&#x79F0;&#x4E3A;&#x524D;&#x7F00;&#x3002;</p>
<p>&#x6211;&#x4EEC;&#x67E5;&#x770B;&#x8FD9;&#x4E2A; pods &#x88AB;&#x90E8;&#x7F72;&#x5230;&#x4E86;&#x54EA;&#x4E2A;&#x8282;&#x70B9;&#x4E0A;&#xFF1A;</p>
<pre class="language-"><code class="lang-bash">kubectl get pods -o wide
</code></pre>
<pre class="language-"><code class="lang-bash">NAME                     READY   STATUS    RESTARTS   AGE     IP              NODE         
nginx-55649fd747-msw8g   <span class="token number">1</span>/1     Running   <span class="token number">0</span>          4h19m   <span class="token number">192.168</span>.56.57   instance-2
</code></pre>
<p>&#x53EF;&#x4EE5;&#x770B;&#x5230;&#xFF0C;&#x8FD9;&#x4E2A; Pod &#x5728; <code>instances-2</code> &#x8FD9;&#x4E2A;&#x8282;&#x70B9;&#x4E0A;&#xFF0C;&#x540C;&#x65F6;&#x8FD9;&#x4E2A; Pod &#x4E5F;&#x6709;&#x4E00;&#x4E2A; IP&#xFF0C;Kubernetes &#x4F1A;&#x4E3A;&#x6BCF;&#x4E2A; Pod &#x5206;&#x914D;&#x4E00;&#x4E2A;&#x552F;&#x4E00;&#x7684; IP&#xFF0C;&#x8FD9;&#x4E2A; IP &#x53EF;&#x4EE5;&#x5728;&#x8282;&#x70B9;&#x4E0A;&#x8BBF;&#x95EE;&#xFF0C;&#x5176;&#x5B83; Pod &#x4E5F;&#x53EF;&#x4EE5;&#x901A;&#x8FC7; IP &#x8BBF;&#x95EE;&#x6B64; Pod&#x3002;</p>
<p>&#x7531;&#x4E8E;&#x8FD9;&#x4E2A; Pod &#x91CC;&#x9762;&#x7684;&#x5BB9;&#x5668;&#x662F; Nginx(80&#x7AEF;&#x53E3;)&#xFF0C;&#x6240;&#x4EE5;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x8BBF;&#x95EE;&#x8FD9;&#x4E2A; IP &#x53EF;&#x4EE5;&#x6253;&#x5F00; Nginx &#x9875;&#x9762;&#x3002;</p>
<pre class="language-"><code>root@instance-1:~# curl 192.168.56.57
<span class="token doctype"><span class="token punctuation">&lt;!</span><span class="token doctype-tag">DOCTYPE</span> <span class="token name">html</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>html</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>head</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>title</span><span class="token punctuation">&gt;</span></span>Welcome to nginx!<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>title</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>style</span><span class="token punctuation">&gt;</span></span>
    body {
... ...
</code></pre><p>&#x5BF9;&#x4E8E;&#x6CA1;&#x6709;&#x6307;&#x5B9A;&#x7684; Deployment&#x3001;Pod&#x3001;Service &#x7B49;&#x5BF9;&#x8C61;&#xFF0C;&#x4F1A;&#x9ED8;&#x8BA4;&#x5206;&#x914D;&#x5230; default &#x547D;&#x540D;&#x7A7A;&#x95F4;&#x4E2D;&#xFF0C;&#x6211;&#x4EEC;&#x5728;&#x6267;&#x884C;<code>kubectl get {}</code> &#x65F6;&#xFF0C;&#x4F1A;&#x83B7;&#x53D6; default &#x547D;&#x540D;&#x7A7A;&#x95F4;&#x4E2D;&#x7684;&#x5BF9;&#x8C61;&#xFF0C; &#x540E;&#x9762;&#x52A0;&#x4E0A; <code>--all-namespaces</code> &#x53EF;&#x4EE5;&#x83B7;&#x5F97;&#x6240;&#x6709;&#x547D;&#x540D;&#x7A7A;&#x95F4;&#x4E2D;&#x7684;&#x5BF9;&#x8C61;&#xFF0C;&#x4F7F;&#x7528; <code>--namespace=</code> &#x53EF;&#x4EE5;&#x6307;&#x5B9A;&#x83B7;&#x53D6;&#x67D0;&#x4E2A;&#x547D;&#x540D;&#x7A7A;&#x95F4;&#x4E2D;&#x7684;&#x5BF9;&#x8C61;&#x3002;</p>
<pre class="language-"><code class="lang-bash">kubectl get pods --all-namespaces
<span class="token comment"># kubectl get pods --namespace=default</span>
</code></pre>
<pre class="language-"><code>NAMESPACE              NAME                                         READY   STATUS      RESTARTS   AGE
default                nginx-55649fd747-msw8g                       1/1     Running     0          4h28m
kube-system            etcd-instance-1                              1/1     Running     1          13d
kube-system            kube-apiserver-instance-1                    1/1     Running     1          13d
kube-system            kube-controller-manager-instance-1           1/1     Running     1          13d
kube-system            kube-proxy-bhj76                             1/1     Running     1          13d
kube-system            kube-proxy-pm597                             1/1     Running     0          13d
kube-system            kube-scheduler-instance-1                    1/1     Running     1          13d
kubernetes-dashboard   dashboard-metrics-scraper-856586f554-4nd9v   1/1     Running     1          13d
kubernetes-dashboard   kubernetes-dashboard-78c79f97b4-288js        1/1     Running     1          13d
</code></pre><p>&#x5728; worker &#x8282;&#x70B9;&#x4E0A;&#x6267;&#x884C; <code>docker ps</code>&#xFF0C;&#x53EF;&#x4EE5;&#x770B;&#x5230; Nginx &#x5BB9;&#x5668;&#xFF1A;</p>
<pre class="language-"><code>root@instance-2:~# docker ps
CONTAINER ID   IMAGE     COMMAND                  CREATED          STATUS          PORTS     NAMES
fe7433f906a0   nginx     &quot;/docker-entrypoint.&#x2026;&quot;   7 seconds ago    Up 6 seconds              k8s_nginx_nginx-55649fd747-wdrjj_default_ea41dcc4-94fe-47f9-a804-5b5b1df703e9_0
</code></pre><h3 id="&#x5B9E;&#x65F6;&#x4FEE;&#x6539;"><a name="&#x5B9E;&#x65F6;&#x4FEE;&#x6539;" class="anchor-navigation-ex-anchor" href="#&#x5B9E;&#x65F6;&#x4FEE;&#x6539;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x5B9E;&#x65F6;&#x4FEE;&#x6539;</h3>
<p>&#x4F7F;&#x7528; <code>kubectl edit</code> &#x53EF;&#x4EE5;&#x5B9E;&#x65F6;&#x4FEE;&#x6539;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;&#x8FD9;&#x91CC;&#x6211;&#x4EEC;&#x4F7F;&#x7528;&#x524D;&#x9762;&#x5DF2;&#x7ECF;&#x90E8;&#x7F72;&#x597D;&#x7684; Nginx &#x8FD9;&#x4E2A; Deployment&#xFF0C;&#x56E0;&#x4E3A;&#x521B;&#x5EFA;&#x7684; Pod &#x540D;&#x79F0;&#x6709;&#x70B9;&#x957F;&#xFF0C;&#x6211;&#x4EEC;&#x5E0C;&#x671B;&#x76F4;&#x63A5;&#x6539;&#x6210; nginx&#x3002;</p>
<p>&#x4FEE;&#x6539; deployment&#xFF1A;</p>
<pre class="language-"><code class="lang-bash">kubectl edit pod nginx-55649fd747-msw8g
</code></pre>
<p>&#x5728; metadata &#x5B57;&#x6BB5;&#x4E2D;&#xFF0C;&#x627E;&#x5230; <code>name: nginx-55649fd747-msw8g</code> &#xFF0C;&#x4FEE;&#x6539;&#x4E3A;&#x5408;&#x9002;&#x7684;&#x540D;&#x79F0;&#x3002;</p>
<p>&#x4FEE;&#x6539;&#x5B8C;&#x6BD5;&#x540E;&#xFF0C;&#x4F1A;&#x63D0;&#x793A;&#xFF1A;</p>
<pre class="language-"><code class="lang-bash">A copy of your changes has been stored to <span class="token string">&quot;/tmp/kubectl-edit-w11bx.yaml&quot;</span>
error: At least one of apiVersion, kind and name was changed
</code></pre>
<p>&#x51FA;&#x4E8E;&#x67D0;&#x4E9B;&#x539F;&#x56E0;&#xFF0C;&#x76F4;&#x63A5;&#x4FEE;&#x6539; name &#x5B57;&#x6BB5;&#x662F;&#x4E0D;&#x884C;&#x7684;&#xFF0C;&#x8FD8;&#x9700;&#x8981;&#x4FEE;&#x6539;&#x5176;&#x5B83;&#x5730;&#x65B9;&#x3002;</p>
<p>&#x8FD9;&#x91CC;&#x8BFB;&#x8005;&#x4E86;&#x89E3;&#xFF0C;&#x53EF;&#x4EE5;&#x901A;&#x8FC7; <code>kubectl edit</code> &#x5B9E;&#x65F6;&#x76F4;&#x63A5;&#x4FEE;&#x6539;&#x5BF9;&#x8C61;&#x5373;&#x53EF;&#x3002;&#x540E;&#x9762;&#x8FD8;&#x4F1A;&#x4ECB;&#x7ECD;&#x53E6;&#x4E00;&#x79CD;&#x4FEE;&#x6539;&#x65B9;&#x6CD5;&#x3002;</p>
<h3 id="&#x5BFC;&#x51FA;-yaml"><a name="&#x5BFC;&#x51FA;-yaml" class="anchor-navigation-ex-anchor" href="#&#x5BFC;&#x51FA;-yaml"><i class="fa fa-link" aria-hidden="true"></i></a>&#x5BFC;&#x51FA; yaml</h3>
<p>&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x4ECE;&#x5DF2;&#x7ECF;&#x521B;&#x5EFA;&#x7684; Deployment &#x3001;Pod&#x3001;Service &#x7B49;&#x5BF9;&#x8C61;&#x5BFC;&#x51FA; yaml &#x6587;&#x4EF6;&#xFF0C;&#x4F7F;&#x7528; <code>-o yaml</code> &#x5373;&#x53EF;&#x5BFC;&#x51FA;(<code>-o json</code> &#x5BFC;&#x51FA;json)&#x3002;</p>
<pre class="language-"><code class="lang-bash">kubectl get deployment nginx -o yaml
<span class="token comment"># &#x4FDD;&#x5B58;&#x5230;&#x6587;&#x4EF6;</span>
<span class="token comment"># kubectl get deployment nginx -o yaml &gt; mynginx.yaml</span>
</code></pre>
<p>&#x7136;&#x540E;&#x7EC8;&#x7AEF;&#x4F1A;&#x6253;&#x5370;&#xFF1A;</p>
<pre class="language-"><code class="lang-bash">apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: <span class="token string">&quot;1&quot;</span>
  creationTimestamp: <span class="token string">&quot;2021-04-21T00:37:13Z&quot;</span>
  generation: <span class="token number">1</span>
  labels:
    app: nginx
  name: nginx
  namespace: default
<span class="token punctuation">..</span>. <span class="token punctuation">..</span>.
</code></pre>
<p>&#x867D;&#x7136;&#x6211;&#x4EEC;&#x521B;&#x5EFA;&#x5BF9;&#x8C61;&#x65F6;&#x7684;&#x547D;&#x4EE4;&#x5F88;&#x7B80;&#x5355;&#xFF0C;&#x4F46;&#x662F;&#x751F;&#x6210;&#x7684; YAML &#x5F88;&#x590D;&#x6742;&#x3002;</p>
<p>&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x5C1D;&#x8BD5;&#x628A; yaml &#x5BFC;&#x51FA;&#x5230; mynginx.yaml &#x6587;&#x4EF6;&#x4E2D;&#xFF0C;&#x7136;&#x540E;&#x6211;&#x4EEC;&#x5220;&#x9664;&#x8FD9;&#x4E2A; Deployment&#x3002;</p>
<pre class="language-"><code class="lang-bash">kubectl get deployment nginx -o yaml <span class="token operator">&gt;</span> mynginx.yaml
</code></pre>
<pre class="language-"><code class="lang-bash">kubectl delete deployment nginx
</code></pre>
<p>&#x7136;&#x540E;&#x5229;&#x7528;&#x5BFC;&#x51FA;&#x7684; mynginx.yaml &#x518D;&#x521B;&#x5EFA;&#x4E00;&#x4E2A; Deployment&#x3002;</p>
<pre class="language-"><code class="lang-bash">kubectl apply -f mynginx.yaml
</code></pre>
<h3 id="&#x591A;&#x4E2A;-&#x5BB9;&#x5668;"><a name="&#x591A;&#x4E2A;-&#x5BB9;&#x5668;" class="anchor-navigation-ex-anchor" href="#&#x591A;&#x4E2A;-&#x5BB9;&#x5668;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x591A;&#x4E2A; &#x5BB9;&#x5668;</h3>
<p>&#x4E00;&#x4E2A; Pod &#x4E2D;&#xFF0C;&#x662F;&#x53EF;&#x4EE5;&#x5305;&#x542B;&#x591A;&#x4E2A;&#x5BB9;&#x5668;&#x7684;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x547D;&#x4EE4;&#x6216; YAML &#x5F62;&#x5F0F;&#x521B;&#x5EFA;&#x5305;&#x542B;&#x591A;&#x4E2A;&#x5BB9;&#x5668;&#x7684; Pod &#x670D;&#x52A1;&#x3002;&#x793A;&#x4F8B;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre class="language-"><code class="lang-yaml">root@master<span class="token punctuation">:</span><span class="token null important">~</span><span class="token comment"># kubectl create deployment testnginx --image=nginx:latest --image=busybox:latest --dry-run=client -o yaml</span>
<span class="token key atrule">apiVersion</span><span class="token punctuation">:</span> apps/v1
<span class="token key atrule">kind</span><span class="token punctuation">:</span> Deployment
<span class="token key atrule">metadata</span><span class="token punctuation">:</span>
  <span class="token key atrule">creationTimestamp</span><span class="token punctuation">:</span> <span class="token null important">null</span>
  <span class="token key atrule">labels</span><span class="token punctuation">:</span>
    <span class="token key atrule">app</span><span class="token punctuation">:</span> testnginx
  <span class="token key atrule">name</span><span class="token punctuation">:</span> testnginx
<span class="token key atrule">spec</span><span class="token punctuation">:</span>
  <span class="token key atrule">replicas</span><span class="token punctuation">:</span> <span class="token number">1</span>
  <span class="token key atrule">selector</span><span class="token punctuation">:</span>
    <span class="token key atrule">matchLabels</span><span class="token punctuation">:</span>
      <span class="token key atrule">app</span><span class="token punctuation">:</span> testnginx
  <span class="token key atrule">strategy</span><span class="token punctuation">:</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
  <span class="token key atrule">template</span><span class="token punctuation">:</span>
    <span class="token key atrule">metadata</span><span class="token punctuation">:</span>
      <span class="token key atrule">creationTimestamp</span><span class="token punctuation">:</span> <span class="token null important">null</span>
      <span class="token key atrule">labels</span><span class="token punctuation">:</span>
        <span class="token key atrule">app</span><span class="token punctuation">:</span> testnginx
    <span class="token key atrule">spec</span><span class="token punctuation">:</span>
      <span class="token key atrule">containers</span><span class="token punctuation">:</span>
      <span class="token punctuation">-</span> <span class="token key atrule">image</span><span class="token punctuation">:</span> nginx<span class="token punctuation">:</span>latest
        <span class="token key atrule">name</span><span class="token punctuation">:</span> nginx
        <span class="token key atrule">resources</span><span class="token punctuation">:</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
      <span class="token punctuation">-</span> <span class="token key atrule">image</span><span class="token punctuation">:</span> busybox<span class="token punctuation">:</span>latest
        <span class="token key atrule">name</span><span class="token punctuation">:</span> busybox
        <span class="token key atrule">resources</span><span class="token punctuation">:</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
<span class="token key atrule">status</span><span class="token punctuation">:</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
</code></pre>
<h3 id="&#x603B;&#x7ED3;"><a name="&#x603B;&#x7ED3;" class="anchor-navigation-ex-anchor" href="#&#x603B;&#x7ED3;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x603B;&#x7ED3;</h3>
<p>&#x672C;&#x5C0F;&#x7AE0;&#x4E2D;&#x4E0D;&#x53EA;&#x662F;&#x8BB2;&#x89E3; Deployment&#xFF0C;&#x8FD8;&#x5305;&#x542B;&#x4E86;&#x5F88;&#x591A;&#x65E5;&#x5E38;&#x7BA1;&#x7406;&#x5BF9;&#x8C61;&#x7684;&#x547D;&#x4EE4;&#xFF0C;&#x8BFB;&#x8005;&#x53EF;&#x591A;&#x505A;&#x7EC3;&#x4E60;&#xFF0C;&#x52A0;&#x6DF1;&#x8BB0;&#x5FC6;&#x3002;</p>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; &#x75F4;&#x8005;&#x5DE5;&#x826F; 2021 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x6587;&#x6863;&#x6700;&#x540E;&#x66F4;&#x65B0;&#x65F6;&#x95F4;&#xFF1A;
2021-11-17 07:18:31
</span></footer>
<script>console.log("plugin-popup....");document.onclick = function(e){ e.target.tagName === "IMG" && window.open(e.target.src,e.target.src)}</script><style>img{cursor:pointer}</style>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="1.pod.html" class="navigation navigation-prev " aria-label="Previous page: 3.1 Pod">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="3.replica.html" class="navigation navigation-next " aria-label="Next page: 3.3 副本集(ReplicaSet)">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"3.2 Deployment部署","level":"1.4.3","depth":2,"next":{"title":"3.3 副本集(ReplicaSet)","level":"1.4.4","depth":2,"path":"3.pod/3.replica.md","ref":"3.pod/3.replica.md","articles":[]},"previous":{"title":"3.1 Pod","level":"1.4.2","depth":2,"path":"3.pod/1.pod.md","ref":"3.pod/1.pod.md","articles":[]},"dir":"ltr"},"config":{"plugins":["tbfed-pagefooter","anchor-navigation-ex","mermaid-gb3","insert-logo","chapter-fold","advanced-emoji","github","splitter","alerts","popup","prism","-highlight","livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy 痴者工良 2021","modify_label":"文档最后更新时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"chapter-fold":{},"prism":{"lang":{"flow":"typescript","shell":"bash"},"ignore":["mermaid","eval-js"],"css":["prismjs/themes/prism.css"],"js":["prismjs/prism.js","prismjs/components.js","prismjs/components/prism-go.min.js","prismjs/components/prism-yaml.min.js","prismjs/components/prism-bash.min.js","prismjs/components/prism-shell-session.min.js"]},"github":{"url":"https://github.com/whuanle/kubernetes"},"livereload":{},"splitter":{},"search":{},"popup":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"mermaid-gb3":{},"anchor-navigation-ex":{"associatedWithSummary":true,"float":{"floatIcon":"fa fa-navicon","level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"mode":"float","multipleH1":true,"pageTop":{"level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"printLog":false,"showGoTop":false,"showLevel":false},"alerts":{},"advanced-emoji":{"embedEmojis":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"insert-logo":{"style":"background: none; max-height: 50px; min-height: 50px","url":"/images/logo.jpg"}},"theme":"default","author":"痴者工良","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Kubernetes - 痴者工良","language":"zh-hans","links":{"sidebar":{"痴者工良的博客":"https://www.whuanle.cn"}},"gitbook":"*","description":"这是一本关于 Kubernetes 的书，作者 痴者工良"},"file":{"path":"3.pod/2.deployment.md","mtime":"2021-11-16T23:18:31.084Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-11-16T23:21:22.294Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-mermaid-gb3/book/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-insert-logo/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-alerts/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    <script src="../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.min.js"></script>

    </body>
</html>

